Cherry Pickup Ii - Leetcode 1463 - Python